/**
 * 
 */
$(document).ready(function() {
	

	$('#userLogin').click(function(){
		var id = $("#id").val();
		var password = $("#password").val();
		var verify1 = $("#verify1").val();
		var verify2 = $("#verify2").val();
		if(id == "" || id == null){
			alert("账号不能为空");
			return;
		}
		if(password == "" || password == null){
			alert("密码不能为空");
			return;
		}
		if(verify1 == "" || verify1 == null){
			alert("验证码不能为空");
			return;
		}
		if(verify2 != verify1){
			alert("验证码错误");
			return;
		}
		$.get(
			"login",
			{"id":id,"password":password},
			function(result){
				if(result == 3){
					//history.back(-1);
					window.location.href="a";
				} else if(result == 2){
					alert("帐号被冻结");
				}else if(result == 1){
					alert("帐号不存在");
				}else{
					alert("密码错误");
				}
			}
			
		)
	});
	$('#userRegister').click(function(){
		window.location.href="register.jsp";
	});
	
});